package cn.skcks.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

// 代表这个类会被 Spring 接管
// 被 Controller 注解的类 如果返回值为 String, 并且有具体页面可以跳转, 那么就会被视图解析器解析
@Controller
public class TestController2 {

	@RequestMapping(value = "/test2",method = RequestMethod.GET)
	public String test2(Model model){
		model.addAttribute("msg","TestController2 Annotation");
		return "test";
	}

	@RequestMapping(value = "/test3",method = RequestMethod.GET)
	public String test(Model model){
		model.addAttribute("msg","TestController3 Annotation");
		return "test";
	}
}